package main
import (
	"fmt"
)



/*
	编写一个函数，可以判断输入的参数是什么类型
*/

//items... interface{} // 任意多个任意类型的实参
func TypeJudge(items... interface{}){
	for i,x:=range items{
		switch x.(type) {
			case bool:
				fmt.Printf("第%v个参数是 bool 类型，value=%v \n",i,x)
			
			case float32:
				fmt.Printf("第%v个参数是 float32 类型，value=%v\n",i,x)
			
			case float64:
				fmt.Printf("第%v个参数是 float64 类型，value=%v\n",i,x)
			
			case int,int32,int64:
				fmt.Printf("第%v个参数是 整数 类型，value=%v\n",i,x)
			
			case string:
				fmt.Printf("第%v个参数是 string 类型，value=%v\n",i,x)
			case Student:
				fmt.Printf("第%v个参数是 Student 类型，value=%v\n",i,x)
			case *Student:
				fmt.Printf("第%v个参数是 *Student 类型，value=%v\n",i,x)
			default:
				fmt.Printf("第%v个参数是  未知 类型，value=%v\n",i,x)
		}
	}
}

type Student struct{

}

func main(){
	
	var (
		n1 = 1.1
		n2 = 30
		address = "北京"
		n4 = 300
		stu = Student{}
	)
	TypeJudge(n1,n2,address,n4,stu,&stu)
}